Show / Hide Table of Contents

    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.

    Namespace: TradingPlatform.BusinessLayer
    Syntax
    public class Core : IDisposable, IBusinessObjectsProvider

    Properties

    AccountOperations

    Declaration
    public AccountOperation[] AccountOperations { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.AccountOperation[]

    Accounts

    Gets all available Accounts from open connections

    Declaration
    public Account[] Accounts { get; }
    Property Value
    Type Description
    Account[]

    Assets

    Gets all available Assets from open connections

    Declaration
    public Asset[] Assets { get; }
    Property Value
    Type Description
    Asset[]

    BrandingInformation

    Declaration
    public IBrandingInformation BrandingInformation { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.IBrandingInformation

    ClosedPositions

    Gets all available TradingPlatform.BusinessLayer.ClosedPositions from open connections

    Declaration
    public ClosedPosition[] ClosedPositions { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.ClosedPosition[]

    Connections

    Gets an access to all created connections and manages them

    Declaration
    public ConnectionsManager Connections { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.ConnectionsManager

    CorporateActions

    Gets all available CorporateActions from open connections

    Declaration
    public CorporateAction[] CorporateActions { get; }
    Property Value
    Type Description
    CorporateAction[]

    CurrentVersion

    Declaration
    public Version CurrentVersion { get; }
    Property Value
    Type Description
    Version

    CustomSessions

    Declaration
    public CustomSessionsManager CustomSessions { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.CustomSessionsManager

    DealTickets

    Gets all available TradingPlatform.BusinessLayer.DealTickets from open connections

    Declaration
    public DealTicket[] DealTickets { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.DealTicket[]

    DeliveredAssets

    Declaration
    public DeliveredAsset[] DeliveredAssets { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.DeliveredAsset[]

    Exchanges

    Gets all available Exchanges from open connections

    Declaration
    public Exchange[] Exchanges { get; }
    Property Value
    Type Description
    Exchange[]

    Indicators

    Gets an access to the all available indicators and creates them

    Declaration
    public IndicatorManager Indicators { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.IndicatorManager

    Instance

    Gets a singleton instance of Core. API entry point

    Declaration
    public static Core Instance { get; }
    Property Value
    Type Description
    Core

    LocalOrders

    Declaration
    public LocalOrdersManager LocalOrders { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.LocalOrders.LocalOrdersManager

    Loggers

    Gets an access to the system logging mechanism

    Declaration
    public LoggerManager Loggers { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.LoggerManager

    MailUtils

    Gets SMTP mail service for sending emails

    Declaration
    public MailUtils MailUtils { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.MailUtils

    Messengers

    Declaration
    public MessengersManager Messengers { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.Media.Messengers.MessengersManager

    OrderPlacingStrategies

    Declaration
    public OrderPlacingStrategiesManager OrderPlacingStrategies { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.OrderPlacingStrategiesManager

    Orders

    Gets all available Orders from open connections

    Declaration
    public Order[] Orders { get; }
    Property Value
    Type Description
    Order[]

    OrderTypes

    Gets all available TradingPlatform.BusinessLayer.OrderTypes from open connections

    Declaration
    public OrderType[] OrderTypes { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.OrderType[]

    Positions

    Gets all available Positions from open connections

    Declaration
    public Position[] Positions { get; }
    Property Value
    Type Description
    Position[]

    ReportTypes

    Gets all available TradingPlatform.BusinessLayer.ReportTypes from open connections. Otherwise returns empty list

    Declaration
    public ReportType[] ReportTypes { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.ReportType[]

    Strategies

    Gets an access to the all available trading strategies and manages them

    Declaration
    public StrategyManager Strategies { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.StrategyManager

    Symbols

    Gets all available Symbols from open connections

    Declaration
    public Symbol[] Symbols { get; }
    Property Value
    Type Description
    Symbol[]

    SymbolsMapping

    Declaration
    public SymbolsMappingManager SymbolsMapping { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.SymbolsMappingManager

    SymbolTypes

    Gets all available TradingPlatform.BusinessLayer.SymbolTypes from open connections

    Declaration
    public SymbolType[] SymbolTypes { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.SymbolType[]

    TimeUtils

    Gets a time based conversion and synchronization mechanism

    Declaration
    public TimeUtils TimeUtils { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.TimeUtils

    TradingProtection

    Declaration
    public TradingProtector TradingProtection { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.Utils.TradingProtection.TradingProtector

    TradingStatus

    Represents current trading status

    Declaration
    public TradingStatus TradingStatus { get; set; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.TradingStatus

    VolumeAnalysis

    Access to Volume Analysis calculations

    Declaration
    public VolumeAnalysisManager VolumeAnalysis { get; }
    Property Value
    Type Description
    VolumeAnalysisManager

    Methods

    Alert(String, String, String, Action)

    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

    Alert(String, String, String, Action, String)

    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

    Alert(Alert)

    Declaration
    public void Alert(Alert alert)
    Parameters
    Type Name Description
    TradingPlatform.BusinessLayer.Utils.Alert alert

    CalculatePnL(PnLRequestParameters)

    Gets Profit'n'Loss TradingPlatform.BusinessLayer.PnL with given request parameters from open connection. Otherwise returns null

    Declaration
    public PnL CalculatePnL(PnLRequestParameters parameters)
    Parameters
    Type Name Description
    PnLRequestParameters parameters
    Returns
    Type Description
    TradingPlatform.BusinessLayer.PnL

    CancelOrder(CancelOrderRequestParameters)

    Cancels Order with given request parameters

    Declaration
    public TradingOperationResult CancelOrder(CancelOrderRequestParameters request)
    Parameters
    Type Name Description
    CancelOrderRequestParameters request
    Returns
    Type Description
    TradingPlatform.BusinessLayer.TradingOperationResult

    CancelOrder(Order)

    Declaration
    public TradingOperationResult CancelOrder(Order order)
    Parameters
    Type Name Description
    Order order
    Returns
    Type Description
    TradingPlatform.BusinessLayer.TradingOperationResult

    ClosePosition(ClosePositionRequestParameters)

    Closes Position with given request parameters

    Declaration
    public TradingOperationResult ClosePosition(ClosePositionRequestParameters request)
    Parameters
    Type Name Description
    ClosePositionRequestParameters request
    Returns
    Type Description
    TradingPlatform.BusinessLayer.TradingOperationResult

    ClosePosition(Position, Double)

    Declaration
    public TradingOperationResult ClosePosition(Position position, double closeQuantity = null)
    Parameters
    Type Name Description
    Position position
    System.Double closeQuantity
    Returns
    Type Description
    TradingPlatform.BusinessLayer.TradingOperationResult

    ForceTimeSync()

    Declaration
    public void ForceTimeSync()

    GetAccount(BusinessObjectInfo)

    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
    Type Description
    Account

    GetOrderById(String, String)

    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
    Type Description
    Order

    GetOrderType(String, String)

    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

    GetPositionById(String, String)

    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
    Type Description
    Position

    GetReport(ReportRequestParameters)

    Returns TradingPlatform.BusinessLayer.Report with given request parameters from open connection

    Declaration
    public Report GetReport(ReportRequestParameters requestParameters)
    Parameters
    Type Name Description
    ReportRequestParameters requestParameters
    Returns
    Type Description
    TradingPlatform.BusinessLayer.Report

    GetSymbol(BusinessObjectInfo)

    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
    Type Description
    Symbol

    GetSymbol(GetSymbolRequestParameters, String, NonFixedListDownload)

    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
    Type Description
    Symbol

    InitializeBrandingInformation()

    Declaration
    public void InitializeBrandingInformation()

    ModifyOrder(ModifyOrderRequestParameters)

    Modifies Order by given request parameters

    Declaration
    public TradingOperationResult ModifyOrder(ModifyOrderRequestParameters request)
    Parameters
    Type Name Description
    ModifyOrderRequestParameters request
    Returns
    Type Description
    TradingPlatform.BusinessLayer.TradingOperationResult

    ModifyOrder(Order, TimeInForce, Double, Double, Double, Double)

    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

    PlaceOrder(PlaceOrderRequestParameters)

    Places Order with given request parameters

    Declaration
    public TradingOperationResult PlaceOrder(PlaceOrderRequestParameters request)
    Parameters
    Type Name Description
    PlaceOrderRequestParameters request
    Returns
    Type Description
    TradingPlatform.BusinessLayer.TradingOperationResult

    PlaceOrder(Symbol, Account, Side, TimeInForce, Double, Double, Double, Double)

    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

    PlaceOrders(ICollection<PlaceOrderRequestParameters>, GroupOrderType)

    Places multiple Orders with given request parameters

    Declaration
    public void PlaceOrders(ICollection<PlaceOrderRequestParameters> requests, GroupOrderType groupOrderType = GroupOrderType.None)
    Parameters
    Type Name Description
    ICollection<PlaceOrderRequestParameters> requests
    TradingPlatform.BusinessLayer.GroupOrderType groupOrderType

    SendCustomRequest(String, RequestParameters)

    Sends custom request if connection with given Id is open

    Declaration
    public void SendCustomRequest(string connectionId, RequestParameters parameters)
    Parameters
    Type Name Description
    System.String connectionId
    RequestParameters parameters

    SubscribeToCustomMessages(Action<CustomMessage>, Int32[])

    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

    UnsubscribeFromCustomMessages(Action<CustomMessage>, Int32[])

    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

    AccountAdded

    Will be triggered when new Account added to the core

    Declaration
    public event Action<Account> AccountAdded
    Event Type
    Type Description
    Action<Account>

    ClosedPositionAdded

    Will be triggered when new TradingPlatform.BusinessLayer.ClosedPosition added

    Declaration
    public event Action<ClosedPosition> ClosedPositionAdded
    Event Type
    Type Description
    Action<TradingPlatform.BusinessLayer.ClosedPosition>

    ClosedPositionRemoved

    Will be triggered when TradingPlatform.BusinessLayer.ClosedPosition removed

    Declaration
    public event Action<ClosedPosition> ClosedPositionRemoved
    Event Type
    Type Description
    Action<TradingPlatform.BusinessLayer.ClosedPosition>

    CorporateActionAdded

    Will be triggered when new CorporateAction occured

    Declaration
    public event Action<CorporateAction> CorporateActionAdded
    Event Type
    Type Description
    Action<CorporateAction>

    DealTicketReceived

    Will be triggered when new TradingPlatform.BusinessLayer.DealTicket received

    Declaration
    public event Action<DealTicket> DealTicketReceived
    Event Type
    Type Description
    Action<TradingPlatform.BusinessLayer.DealTicket>

    DeliveredAssetAdded

    Declaration
    public event Action<DeliveredAsset> DeliveredAssetAdded
    Event Type
    Type Description
    Action<TradingPlatform.BusinessLayer.DeliveredAsset>

    DeliveredAssetRemoved

    Declaration
    public event Action<DeliveredAsset> DeliveredAssetRemoved
    Event Type
    Type Description
    Action<TradingPlatform.BusinessLayer.DeliveredAsset>

    OnAlert

    Declaration
    public event Action<Alert> OnAlert
    Event Type
    Type Description
    Action<TradingPlatform.BusinessLayer.Utils.Alert>

    OnTradingStatusChanged

    Will be triggered when TradingStatus changed

    Declaration
    public event Action<TradingStatus> OnTradingStatusChanged
    Event Type
    Type Description
    Action<TradingPlatform.BusinessLayer.TradingStatus>

    OrderAdded

    Will be triggered when new Order placed

    Declaration
    public event Action<Order> OrderAdded
    Event Type
    Type Description
    Action<Order>

    OrderRemoved

    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>

    PositionAdded

    Will be triggered when new Position opened

    Declaration
    public event Action<Position> PositionAdded
    Event Type
    Type Description
    Action<Position>

    PositionRemoved

    Will be triggered when Position closed

    Declaration
    public event Action<Position> PositionRemoved
    Event Type
    Type Description
    Action<Position>

    SymbolAdded

    Will be triggered when new Symbol added to the core

    Declaration
    public event Action<Symbol> SymbolAdded
    Event Type
    Type Description
    Action<Symbol>

    TradeAdded

    Will be triggered when new Trade occured

    Declaration
    public event Action<Trade> TradeAdded
    Event Type
    Type Description
    Action<Trade>
    Back to top Copyright QUANTOWER LLC. © 2017-2021. All rights reserved.