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 00000000..62309917
Binary files /dev/null and b/.sonarlint/._QuanTAlib.json differ
diff --git a/.sonarlint/QuanTAlib.json b/.sonarlint/QuanTAlib.json
index f75a1bc1..5ead4d0b 100644
--- a/.sonarlint/QuanTAlib.json
+++ b/.sonarlint/QuanTAlib.json
@@ -1,4 +1,5 @@
{
"sonarCloudOrganization": "mihakralj-quantalib",
- "projectKey": "mihakralj_QuanTAlib"
+ "projectKey": "mihakralj_QuanTAlib",
+ "region": "EU"
}
\ No newline at end of file
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index d23a4a35..efeabb26 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,7 +1,7 @@
-{
- "recommendations": [
- "ms-dotnettools.csdevkit",
- "ms-dotnettools.csharp",
- "bierner.markdown-mermaid"
- ]
-}
+{
+ "recommendations": [
+ "ms-dotnettools.csdevkit",
+ "ms-dotnettools.csharp",
+ "bierner.markdown-mermaid"
+ ]
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index d656a7dc..1eda022f 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,190 +1,191 @@
-{
- // ???????????????????????????????????????????????????????????????????
- // GitHub Copilot Settings for QuanTAlib Workspace
- // Optimized for high-performance financial library development
- // ???????????????????????????????????????????????????????????????????
-
- // ?????????????????????????????????????????????????????????????????
- // Copilot Core Settings
- // ?????????????????????????????????????????????????????????????????
-
- // Enable Copilot completions (suggestions appear automatically)
- "github.copilot.editor.enableAutoCompletions": true,
-
- // Enable Copilot for all file types
- "github.copilot.enable": {
- "*": true,
- "plaintext": false,
- "markdown": true,
- "scminput": false
- },
-
- // Show inline suggestions
- "editor.inlineSuggest.enabled": true,
-
- // Always show the inline suggestion toolbar
- "editor.inlineSuggest.showToolbar": "always",
-
- // ?????????????????????????????????????????????????????????????????
- // Copilot Chat Settings (Manual Review Required)
- // ?????????????????????????????????????????????????????????????????
-
- // DO NOT auto-apply chat edits - require manual review for quality control
- "chat.editing.autoApply": "off",
-
- // Confirm before removing edit requests
- "chat.editing.confirmEditRequestRemoval": true,
-
- // Show chat panel on the side
- "chat.editor.wordWrap": "on",
-
- // ?????????????????????????????????????????????????????????????????
- // Editor Settings for Productivity
- // ?????????????????????????????????????????????????????????????????
-
- // Enable quick suggestions in all contexts
- "editor.quickSuggestions": {
- "other": true,
- "comments": true,
- "strings": true
- },
-
- // Show suggestions on trigger characters
- "editor.suggestOnTriggerCharacters": true,
-
- // Accept suggestion on commit character (like dot, parenthesis)
- "editor.acceptSuggestionOnCommitCharacter": true,
-
- // Faster suggestion appearance
- "editor.quickSuggestionsDelay": 0,
-
- // Show snippet suggestions with other suggestions
- "editor.snippetSuggestions": "inline",
-
- // Tab key behavior
- "editor.tabCompletion": "on",
-
- // ?????????????????????????????????????????????????????????????????
- // C# Specific Settings
- // ?????????????????????????????????????????????????????????????????
-
- "[csharp]": {
- "editor.formatOnSave": true,
- "editor.formatOnPaste": true,
- "editor.codeActionsOnSave": {
- "source.organizeImports": "explicit"
- },
- "editor.quickSuggestions": {
- "other": true,
- "comments": true,
- "strings": true
- }
- },
-
- // ?????????????????????????????????????????????????????????????????
- // Performance & Quality Control
- // ?????????????????????????????????????????????????????????????????
-
- // Save automatically (helps with Copilot context)
- "files.autoSave": "afterDelay",
- "files.autoSaveDelay": 1000,
-
- // Show whitespace (important for performance-critical code)
- "editor.renderWhitespace": "boundary",
-
- // Show inline parameter hints
- "editor.inlayHints.enabled": "on",
-
- // Highlight matching brackets
- "editor.bracketPairColorization.enabled": true,
- "editor.guides.bracketPairs": true,
-
- // ?????????????????????????????????????????????????????????????????
- // Git Integration
- // ?????????????????????????????????????????????????????????????????
-
- // Auto-fetch git changes
- "git.autofetch": true,
-
- // Confirm before synchronizing
- "git.confirmSync": false,
-
- // Show inline blame
- "git.decorations.enabled": true,
-
- // ?????????????????????????????????????????????????????????????????
- // Terminal Settings (Preserved from original)
- // ?????????????????????????????????????????????????????????????????
-
- "terminal.integrated.defaultProfile.windows": "PowerShell",
- "terminal.integrated.profiles.windows": {
- "PowerShell": {
- "source": "PowerShell",
- "icon": "terminal-powershell"
- }
- },
- "terminal.integrated.shellIntegration.enabled": true,
- "terminal.integrated.suggest.enabled": true,
-
- // ?????????????????????????????????????????????????????????????????
- // File Exclusions (Reduce Noise)
- // ?????????????????????????????????????????????????????????????????
-
- "files.exclude": {
- "**/bin": true,
- "**/obj": true,
- "**/.vs": true,
- "**/node_modules": true,
- "**/.git": false
- },
-
- "search.exclude": {
- "**/bin": true,
- "**/obj": true,
- "**/node_modules": true,
- "**/.vs": true,
- "**/coverage": true
- },
-
- // ?????????????????????????????????????????????????????????????????
- // .NET Specific Settings
- // ?????????????????????????????????????????????????????????????????
-
- "omnisharp.enableEditorConfigSupport": true,
- "omnisharp.enableRoslynAnalyzers": true,
- "dotnet.backgroundAnalysis.enabled": true,
-
- // ?????????????????????????????????????????????????????????????????
- // Testing Integration
- // ?????????????????????????????????????????????????????????????????
-
- "dotnet.defaultSolution": "QuanTAlib.sln",
- "dotnet.testController.enabled": true,
- "dotnet.testExplorer.enabled": true,
- "dotnet-test-explorer.autoExpandTree": true,
- "dotnet-test-explorer.autoWatch": false,
- "dotnet-test-explorer.runAfterBuild": false,
- "dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true,
- "dotnet.server.useOmnisharp": false,
-
- "testing.automaticallyOpenPeekView": "never",
- "testing.openTesting": "neverOpen",
- "testing.automaticallyOpenTestResults": "neverOpen"
-
- // ???????????????????????????????????????????????????????????????????
- // Keyboard Shortcuts Reference
- // ???????????????????????????????????????????????????????????????????
- // Tab - Accept inline suggestion
- // Ctrl+? - Accept next word
- // Ctrl+Enter - Accept line
- // Esc - Dismiss suggestion
- // Alt+] - Next suggestion
- // Alt+[ - Previous suggestion
- // Ctrl+I - Open Copilot Chat
- //
- // Quality Control Reminders:
- // ? Review all Copilot suggestions for optimization patterns
- // ? Run tests after accepting: dotnet test
- // ? Check performance impact with benchmarks
- // ? Validate against reference implementations
-}
+{
+ // ???????????????????????????????????????????????????????????????????
+ // GitHub Copilot Settings for QuanTAlib Workspace
+ // Optimized for high-performance financial library development
+ // ???????????????????????????????????????????????????????????????????
+
+ // ?????????????????????????????????????????????????????????????????
+ // Copilot Core Settings
+ // ?????????????????????????????????????????????????????????????????
+
+ // Enable Copilot completions (suggestions appear automatically)
+ "github.copilot.editor.enableAutoCompletions": true,
+
+ // Enable Copilot for all file types
+ "github.copilot.enable": {
+ "*": true,
+ "plaintext": false,
+ "markdown": true,
+ "scminput": false
+ },
+
+ // Show inline suggestions
+ "editor.inlineSuggest.enabled": true,
+
+ // Always show the inline suggestion toolbar
+ "editor.inlineSuggest.showToolbar": "always",
+
+ // ?????????????????????????????????????????????????????????????????
+ // Copilot Chat Settings (Manual Review Required)
+ // ?????????????????????????????????????????????????????????????????
+
+ // DO NOT auto-apply chat edits - require manual review for quality control
+ "chat.editing.autoApply": "off",
+
+ // Confirm before removing edit requests
+ "chat.editing.confirmEditRequestRemoval": true,
+
+ // Show chat panel on the side
+ "chat.editor.wordWrap": "on",
+
+ // ?????????????????????????????????????????????????????????????????
+ // Editor Settings for Productivity
+ // ?????????????????????????????????????????????????????????????????
+
+ // Enable quick suggestions in all contexts
+ "editor.quickSuggestions": {
+ "other": true,
+ "comments": true,
+ "strings": true
+ },
+
+ // Show suggestions on trigger characters
+ "editor.suggestOnTriggerCharacters": true,
+
+ // Accept suggestion on commit character (like dot, parenthesis)
+ "editor.acceptSuggestionOnCommitCharacter": true,
+
+ // Faster suggestion appearance
+ "editor.quickSuggestionsDelay": 0,
+
+ // Show snippet suggestions with other suggestions
+ "editor.snippetSuggestions": "inline",
+
+ // Tab key behavior
+ "editor.tabCompletion": "on",
+
+ // ?????????????????????????????????????????????????????????????????
+ // C# Specific Settings
+ // ?????????????????????????????????????????????????????????????????
+
+ "[csharp]": {
+ "editor.formatOnSave": true,
+ "editor.formatOnPaste": true,
+ "editor.codeActionsOnSave": {
+ "source.organizeImports": "explicit"
+ },
+ "editor.quickSuggestions": {
+ "other": true,
+ "comments": true,
+ "strings": true
+ }
+ },
+
+ // ?????????????????????????????????????????????????????????????????
+ // Performance & Quality Control
+ // ?????????????????????????????????????????????????????????????????
+
+ // Save automatically (helps with Copilot context)
+ "files.autoSave": "afterDelay",
+ "files.autoSaveDelay": 1000,
+
+ // Show whitespace (important for performance-critical code)
+ "editor.renderWhitespace": "boundary",
+
+ // Show inline parameter hints
+ "editor.inlayHints.enabled": "on",
+
+ // Highlight matching brackets
+ "editor.bracketPairColorization.enabled": true,
+ "editor.guides.bracketPairs": true,
+
+ // ?????????????????????????????????????????????????????????????????
+ // Git Integration
+ // ?????????????????????????????????????????????????????????????????
+
+ // Auto-fetch git changes
+ "git.autofetch": true,
+
+ // Confirm before synchronizing
+ "git.confirmSync": false,
+
+ // Show inline blame
+ "git.decorations.enabled": true,
+
+ // ?????????????????????????????????????????????????????????????????
+ // Terminal Settings (Preserved from original)
+ // ?????????????????????????????????????????????????????????????????
+
+ "terminal.integrated.defaultProfile.windows": "PowerShell",
+ "terminal.integrated.profiles.windows": {
+ "PowerShell": {
+ "source": "PowerShell",
+ "icon": "terminal-powershell"
+ }
+ },
+ "terminal.integrated.shellIntegration.enabled": true,
+ "terminal.integrated.suggest.enabled": true,
+
+ // ?????????????????????????????????????????????????????????????????
+ // File Exclusions (Reduce Noise)
+ // ?????????????????????????????????????????????????????????????????
+
+ "files.exclude": {
+ "**/bin": true,
+ "**/obj": true,
+ "**/.vs": true,
+ "**/node_modules": true,
+ "**/.git": false
+ },
+
+ "search.exclude": {
+ "**/bin": true,
+ "**/obj": true,
+ "**/node_modules": true,
+ "**/.vs": true,
+ "**/coverage": true
+ },
+
+ // ?????????????????????????????????????????????????????????????????
+ // .NET Specific Settings
+ // ?????????????????????????????????????????????????????????????????
+
+ "omnisharp.enableEditorConfigSupport": true,
+ "omnisharp.enableRoslynAnalyzers": true,
+ "dotnet.backgroundAnalysis.enabled": true,
+
+ // ?????????????????????????????????????????????????????????????????
+ // Testing Integration
+ // ?????????????????????????????????????????????????????????????????
+
+ "dotnet.defaultSolution": "QuanTAlib.sln",
+ "dotnet.testController.enabled": true,
+ "dotnet.unitTests.runSettingsPath": "",
+ "dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true,
+ "dotnet.server.useOmnisharp": false,
+
+ "testing.automaticallyOpenPeekView": "never",
+ "testing.openTesting": "neverOpen",
+ "testing.automaticallyOpenTestResults": "neverOpen",
+ "sonarlint.connectedMode.project": {
+ "connectionId": "mihakralj-quantalib",
+ "projectKey": "mihakralj_QuanTAlib"
+ }
+
+ // ???????????????????????????????????????????????????????????????????
+ // Keyboard Shortcuts Reference
+ // ???????????????????????????????????????????????????????????????????
+ // Tab - Accept inline suggestion
+ // Ctrl+? - Accept next word
+ // Ctrl+Enter - Accept line
+ // Esc - Dismiss suggestion
+ // Alt+] - Next suggestion
+ // Alt+[ - Previous suggestion
+ // Ctrl+I - Open Copilot Chat
+ //
+ // Quality Control Reminders:
+ // ? Review all Copilot suggestions for optimization patterns
+ // ? Run tests after accepting: dotnet test
+ // ? Check performance impact with benchmarks
+ // ? Validate against reference implementations
+}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index aa1fd30c..5a73d2d8 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -7,7 +7,7 @@
"type": "process",
"args": [
"test",
- "${workspaceFolder}/tests/QuanTAlib.Tests/QuanTAlib.Tests.csproj",
+ "${workspaceFolder}/lib/QuanTAlib.Tests.csproj",
"--framework",
"net10.0"
],
@@ -27,7 +27,7 @@
"type": "process",
"args": [
"test",
- "${workspaceFolder}/tests/QuanTAlib.Tests/QuanTAlib.Tests.csproj"
+ "${workspaceFolder}/lib/QuanTAlib.Tests.csproj"
],
"problemMatcher": "$msCompile",
"group": "test",
diff --git a/Directory.Build.props b/Directory.Build.props
index 681f6bc6..cfdf1c70 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,60 +1,60 @@
-
-
- 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 @@
+[](https://sonarcloud.io/summary/overall?id=mihakralj_QuanTAlib)
+[](https://app.codacy.com/gh/mihakralj/QuanTAlib/dashboard)
+[](https://codecov.io/gh/mihakralj/QuanTAlib)
+[](https://sonarcloud.io/summary/new_code?id=mihakralj_QuanTAlib)
+[](https://www.codefactor.io/repository/github/mihakralj/quantalib/overview/main)
+
+[](https://www.nuget.org/packages/QuanTAlib/)
+
+[](https://www.nuget.org/packages/QuanTAlib/)
+[](https://github.com/mihakralj/QuanTAlib/watchers)
+[](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, double> ??;
-
- 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