Class Core
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 acces the Core object via static Core.Instance property.
public class Core : IDisposable, IBusinessObjectsProvider
Properties
Declaration
public AccountOperation[] AccountOperations { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.AccountOperation []
Gets all available Account s from open connections
Declaration
public Account[] Accounts { get; }
Property Value
Gets all available Asset s from open connections
Declaration
public Asset[] Assets { get; }
Property Value
Declaration
public IBrandingInformation BrandingInformation { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.IBrandingInformation
Gets all available TradingPlatform.BusinessLayer.ClosedPosition s from open connections
Declaration
public ClosedPosition[] ClosedPositions { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.ClosedPosition []
Gets an access to all created connections and manages them
Declaration
public ConnectionsManager Connections { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.ConnectionsManager
Declaration
public CorporateAction[] CorporateActions { get; }
Property Value
Declaration
public Version CurrentVersion { get; }
Property Value
Declaration
public CustomSessionsManager CustomSessions { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.CustomSessionsManager
Gets all available TradingPlatform.BusinessLayer.DealTicket s from open connections
Declaration
public DealTicket[] DealTickets { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.DealTicket []
Declaration
public DeliveredAsset[] DeliveredAssets { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.DeliveredAsset []
Gets all available Exchange s from open connections
Declaration
public Exchange[] Exchanges { get; }
Property Value
Gets an access to the all available indicators and creates them
Declaration
public IndicatorManager Indicators { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.IndicatorManager
Gets a singleton instance of Core . API entry point
Declaration
public static Core Instance { get; }
Property Value
Declaration
public LocalOrdersManager LocalOrders { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.LocalOrders.LocalOrdersManager
Gets an access to the system logging mechanism
Declaration
public LoggerManager Loggers { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.LoggerManager
Gets SMTP mail service for sending emails
Declaration
public MailUtils MailUtils { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.MailUtils
Declaration
public MessengersManager Messengers { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.Media.Messengers.MessengersManager
Declaration
public OrderPlacingStrategiesManager OrderPlacingStrategies { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.OrderPlacingStrategiesManager
Gets all available Order s from open connections
Declaration
public Order[] Orders { get; }
Property Value
Gets all available TradingPlatform.BusinessLayer.OrderType s from open connections
Declaration
public OrderType[] OrderTypes { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.OrderType []
Gets all available Position s from open connections
Declaration
public Position[] Positions { get; }
Property Value
Gets all available TradingPlatform.BusinessLayer.ReportType s from open connections. Otherwise returns empty list
Declaration
public ReportType[] ReportTypes { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.ReportType []
Gets an access to the all available trading strategies and manages them
Declaration
public StrategyManager Strategies { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.StrategyManager
Gets all available Symbol s from open connections
Declaration
public Symbol[] Symbols { get; }
Property Value
Declaration
public SymbolsMappingManager SymbolsMapping { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.SymbolsMappingManager
Gets all available TradingPlatform.BusinessLayer.SymbolType s from open connections
Declaration
public SymbolType[] SymbolTypes { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.SymbolType []
Gets a time based conversion and synchronization mechanism
Declaration
public TimeUtils TimeUtils { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.TimeUtils
Declaration
public TradingProtector TradingProtection { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.Utils.TradingProtection.TradingProtector
Represents current trading status
Declaration
public TradingStatus TradingStatus { get; set; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.TradingStatus
Access to Volume Analysis calculations
Declaration
public VolumeAnalysisManager VolumeAnalysis { get; }
Property Value
Methods
Declaration
public void Alert(string text, string symbolName = "", string connectionName = "", Action onConfirm = null)
Parameters
Type
Name
Description
System.String
text
System.String
symbolName
System.String
connectionName
Action
onConfirm
Declaration
public void Alert(string text, string symbolName, string connectionName, Action onConfirm, string alertName)
Parameters
Type
Name
Description
System.String
text
System.String
symbolName
System.String
connectionName
Action
onConfirm
System.String
alertName
Declaration
public void Alert(Alert alert)
Parameters
Type
Name
Description
TradingPlatform.BusinessLayer.Utils.Alert
alert
Gets Profit'n'Loss TradingPlatform.BusinessLayer.PnL with given request parameters from open connection. Otherwise returns null
Declaration
public PnL CalculatePnL(PnLRequestParameters parameters)
Parameters
Returns
Type
Description
TradingPlatform.BusinessLayer.PnL
Cancels Order with given request parameters
Declaration
public TradingOperationResult CancelOrder(CancelOrderRequestParameters request)
Parameters
Returns
Type
Description
TradingPlatform.BusinessLayer.TradingOperationResult
Declaration
public TradingOperationResult CancelOrder(Order order)
Parameters
Type
Name
Description
Order
order
Returns
Type
Description
TradingPlatform.BusinessLayer.TradingOperationResult
Closes Position with given request parameters
Declaration
public TradingOperationResult ClosePosition(ClosePositionRequestParameters request)
Parameters
Returns
Type
Description
TradingPlatform.BusinessLayer.TradingOperationResult
Declaration
public TradingOperationResult ClosePosition(Position position, double closeQuantity = null)
Parameters
Type
Name
Description
Position
position
System.Double
closeQuantity
Returns
Type
Description
TradingPlatform.BusinessLayer.TradingOperationResult
Declaration
public void ForceTimeSync()
Gets an instance of exist Account or creates a new one with given info parameter
Declaration
public Account GetAccount(BusinessObjectInfo accountInfo)
Parameters
Type
Name
Description
TradingPlatform.BusinessLayer.BusinessObjectInfo
accountInfo
Returns
Gets Order instance by given Id string. Otherwise returns null
Declaration
public Order GetOrderById(string orderId, string connectionId = null)
Parameters
Type
Name
Description
System.String
orderId
System.String
connectionId
Must be specified if open connections total is more than one
Returns
Gets TradingPlatform.BusinessLayer.OrderType instance by given Id string. Otherwise returns null
Declaration
public OrderType GetOrderType(string orderTypeId, string connectionId = null)
Parameters
Type
Name
Description
System.String
orderTypeId
System.String
connectionId
Must be specified if open connections total is more than one
Returns
Type
Description
TradingPlatform.BusinessLayer.OrderType
Gets Position instance by given Id string. Otherwise returns null
Declaration
public Position GetPositionById(string positionId, string connectionId = null)
Parameters
Type
Name
Description
System.String
positionId
System.String
connectionId
Must be specified if open connections total is more than one
Returns
Returns TradingPlatform.BusinessLayer.Report with given request parameters from open connection
Declaration
public Report GetReport(ReportRequestParameters requestParameters)
Parameters
Returns
Type
Description
TradingPlatform.BusinessLayer.Report
Gets an instance of exist symbol or creates a new one with given info parameter
Declaration
public Symbol GetSymbol(BusinessObjectInfo symbolInfo)
Parameters
Type
Name
Description
TradingPlatform.BusinessLayer.BusinessObjectInfo
symbolInfo
Returns
Retrieves any Symbol by given request parameters. Otherwise returns null
Declaration
public Symbol GetSymbol(GetSymbolRequestParameters requestParameters, string connectionId = null, NonFixedListDownload downloadSymbol = NonFixedListDownload.Download)
Parameters
Type
Name
Description
GetSymbolRequestParameters
requestParameters
System.String
connectionId
Must be specified if open connections total is more than one. Will search only in Synthetic symbols list if id is equal to TradingPlatform.BusinessLayer.Synthetic.SYNTHETIC_CONNECTION_ID
TradingPlatform.BusinessLayer.NonFixedListDownload
downloadSymbol
Returns
Declaration
public void InitializeBrandingInformation()
Modifies Order by given request parameters
Declaration
public TradingOperationResult ModifyOrder(ModifyOrderRequestParameters request)
Parameters
Returns
Type
Description
TradingPlatform.BusinessLayer.TradingOperationResult
Declaration
public TradingOperationResult ModifyOrder(Order order, TimeInForce timeInForce = TimeInForce.Default, double quantity = null, double price = null, double triggerPrice = null, double trailOffset = null)
Parameters
Type
Name
Description
Order
order
TradingPlatform.BusinessLayer.TimeInForce
timeInForce
System.Double
quantity
System.Double
price
System.Double
triggerPrice
System.Double
trailOffset
Returns
Type
Description
TradingPlatform.BusinessLayer.TradingOperationResult
Places Order with given request parameters
Declaration
public TradingOperationResult PlaceOrder(PlaceOrderRequestParameters request)
Parameters
Returns
Type
Description
TradingPlatform.BusinessLayer.TradingOperationResult
Declaration
public TradingOperationResult PlaceOrder(Symbol symbol, Account account, Side side, TimeInForce timeInForce = TimeInForce.Day, double quantity = null, double price = null, double triggerPrice = null, double trailOffset = null)
Parameters
Type
Name
Description
Symbol
symbol
Account
account
TradingPlatform.BusinessLayer.Side
side
TradingPlatform.BusinessLayer.TimeInForce
timeInForce
System.Double
quantity
System.Double
price
System.Double
triggerPrice
System.Double
trailOffset
Returns
Type
Description
TradingPlatform.BusinessLayer.TradingOperationResult
Places multiple Order s with given request parameters
Declaration
public void PlaceOrders(ICollection<PlaceOrderRequestParameters> requests, GroupOrderType groupOrderType = GroupOrderType.None)
Parameters
Sends custom request if connection with given Id is open
Declaration
public void SendCustomRequest(string connectionId, RequestParameters parameters)
Parameters
Subscribe on custom messages
Declaration
public void SubscribeToCustomMessages(Action<CustomMessage> handler, params int[] messagesTypes)
Parameters
Type
Name
Description
Action <TradingPlatform.BusinessLayer.Integration.CustomMessage >
handler
custom message handler
System.Int32 []
messagesTypes
custom messages Id
Unsubscribe from custom messages
Declaration
public void UnsubscribeFromCustomMessages(Action<CustomMessage> handler, params int[] messagesTypes)
Parameters
Type
Name
Description
Action <TradingPlatform.BusinessLayer.Integration.CustomMessage >
handler
custom message handler
System.Int32 []
messagesTypes
custom messages Id
Events
Will be triggered when new Account added to the core
Declaration
public event Action<Account> AccountAdded
Event Type
Will be triggered when new TradingPlatform.BusinessLayer.ClosedPosition added
Declaration
public event Action<ClosedPosition> ClosedPositionAdded
Event Type
Type
Description
Action <TradingPlatform.BusinessLayer.ClosedPosition >
Will be triggered when TradingPlatform.BusinessLayer.ClosedPosition removed
Declaration
public event Action<ClosedPosition> ClosedPositionRemoved
Event Type
Type
Description
Action <TradingPlatform.BusinessLayer.ClosedPosition >
Declaration
public event Action<CorporateAction> CorporateActionAdded
Event Type
Will be triggered when new TradingPlatform.BusinessLayer.DealTicket received
Declaration
public event Action<DealTicket> DealTicketReceived
Event Type
Type
Description
Action <TradingPlatform.BusinessLayer.DealTicket >
Declaration
public event Action<DeliveredAsset> DeliveredAssetAdded
Event Type
Type
Description
Action <TradingPlatform.BusinessLayer.DeliveredAsset >
Declaration
public event Action<DeliveredAsset> DeliveredAssetRemoved
Event Type
Type
Description
Action <TradingPlatform.BusinessLayer.DeliveredAsset >
Declaration
public event Action<Alert> OnAlert
Event Type
Type
Description
Action <TradingPlatform.BusinessLayer.Utils.Alert >
Declaration
public event Action<TradingStatus> OnTradingStatusChanged
Event Type
Type
Description
Action <TradingPlatform.BusinessLayer.TradingStatus >
Will be triggered when new Order placed
Declaration
public event Action<Order> OrderAdded
Event Type
Type
Description
Action <Order >
Will be triggered when Order canceled
Declaration
public event Action<Order> OrderRemoved
Event Type
Type
Description
Action <Order >
OrdersHistoryAdded
Will be triggered when new TradingPlatform.BusinessLayer.OrderHistory added
Declaration
public event Action<OrderHistory> OrdersHistoryAdded
Event Type
Type
Description
Action <TradingPlatform.BusinessLayer.OrderHistory >
Will be triggered when new Position opened
Declaration
public event Action<Position> PositionAdded
Event Type
Declaration
public event Action<Position> PositionRemoved
Event Type
Will be triggered when new Symbol added to the core
Declaration
public event Action<Symbol> SymbolAdded
Event Type
Type
Description
Action <Symbol >
Will be triggered when new Trade occured
Declaration
public event Action<Trade> TradeAdded
Event Type
Type
Description
Action <Trade >
Please enable JavaScript to view the comments powered by Disqus.