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
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
Gets an acces to all created connections and manages them
Declaration
public ConnectionsManager Connections { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.ConnectionsManager
Gets all available TradingPlatform.BusinessLayer.DealTicket s from open connections
Declaration
public DealTicket[] DealTickets { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.DealTicket []
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 singletone instance of Core . API entry point
Declaration
public static Core Instance { get; }
Property Value
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
Gets all available Order s from open connections
Declaration
public Order[] Orders { get; }
Property Value
OrdersHistory
Gets all available TradingPlatform.BusinessLayer.OrderHistory s from open connections
Declaration
public OrderHistory[] OrdersHistory { get; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.OrderHistory []
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
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
Gets all available Trade s from open connections
Declaration
public Trade[] Trades { get; }
Property Value
Represents current trading status
Declaration
public TradingStatus TradingStatus { get; set; }
Property Value
Type
Description
TradingPlatform.BusinessLayer.TradingStatus
Methods
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 = -1)
Parameters
Type
Name
Description
Position
position
System.Double
closeQuantity
Returns
Type
Description
TradingPlatform.BusinessLayer.TradingOperationResult
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 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)
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
Retrives 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
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 = 1, double price = -1, double triggerPrice = -1, double trailOffset = -1)
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 = 1, double price = -1, double triggerPrice = -1, double trailOffset = -1)
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
Sends custom request if connection with given Id is open
Declaration
public void SendCustomRequest(string connectionId, RequestParameters parameters)
Parameters
Subscribes on custom messages
Declaration
public void SubscribeToCustomMessages(Action<CustomMessage> handler, params int[] messagesTypes)
Parameters
Type
Name
Description
System.Action <TradingPlatform.BusinessLayer.Integration.CustomMessage >
handler
custom message handler
System.Int32 []
messagesTypes
custom messages Id
Declaration
Unsubscribes from custom messages
Declaration
public void UnsubscribeFromCustomMessages(Action<CustomMessage> handler, params int[] messagesTypes)
Parameters
Type
Name
Description
System.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
Type
Description
System.Action <Account >
Will be triggered when Account removed from the core
Declaration
public event Action<Account> AccountRemoved
Event Type
Type
Description
System.Action <Account >
Will be triggered when new TradingPlatform.BusinessLayer.DealTicket received
Declaration
public event Action<DealTicket> DealTicketReceived
Event Type
Type
Description
System.Action <TradingPlatform.BusinessLayer.DealTicket >
Declaration
public event Action<TradingStatus> OnTradingStatusChanged
Event Type
Type
Description
System.Action <TradingPlatform.BusinessLayer.TradingStatus >
Will be triggered when new Order placed
Declaration
public event Action<Order> OrderAdded
Event Type
Type
Description
System.Action <Order >
Will be triggered when Order canceled
Declaration
public event Action<Order> OrderRemoved
Event Type
Type
Description
System.Action <Order >
OrdersHistoryAdded
Will be triggered when new TradingPlatform.BusinessLayer.OrderHistory added
Declaration
public event Action<OrderHistory> OrdersHistoryAdded
Event Type
Type
Description
System.Action <TradingPlatform.BusinessLayer.OrderHistory >
Will be triggered when new Position opened
Declaration
public event Action<Position> PositionAdded
Event Type
Type
Description
System.Action <Position >
Declaration
public event Action<Position> PositionRemoved
Event Type
Type
Description
System.Action <Position >
Will be triggered when new Symbol added to the core
Declaration
public event Action<Symbol> SymbolAdded
Event Type
Type
Description
System.Action <Symbol >
Will be triggered when Symbol removed from the core
Declaration
public event Action<Symbol> SymbolRemoved
Event Type
Type
Description
System.Action <Symbol >
Will be triggered when new Trade occured
Declaration
public event Action<Trade> TradeAdded
Event Type
Type
Description
System.Action <Trade >
Please enable JavaScript to view the comments powered by Disqus.